<template>
  <div class="content">
    <!-- the Nvar -->
    <van-sticky>
      <van-nav-bar title="主页" />
    </van-sticky>
    <div>
      <van-swipe @change="onChange">
        <van-swipe-item>
          <img src="@/assets/imgs/banner.jpg" class="scansell-img" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/imgs/banner.jpg" class="scansell-img" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/imgs/banner.jpg" class="scansell-img" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/imgs/banner.jpg" class="scansell-img" />
        </van-swipe-item>
        <template #indicator>
          <div class="custom-indicator">{{ current + 1 }}/4</div>
        </template>
      </van-swipe>
    </div>
    <div class="clomn-style">
      <div v-for="(items, index) in this.list" :key="index" class="row-style">
        <div v-for="(item, index1) in items" :key="index + '-' + index1" style="text-aligin:center">
          <div class="icon-style" @click="toRouter(item.router)">
            <i
              :class="['iconfont', item.icon]"
              style="font-size:27px;line-height:50px;color:#07c160;"
            ></i>
            <br />
          </div>
          <span>{{ item.name }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Scancell",
  data() {
    return {
      current: 0,
      list: [
        [
          {
            name: "扫码收集",
            icon: "icon-icon-",
            router: "/ScanColl/ScanCodeCell",
          },
          {
            name: "箱袋绑定",
            icon: "icon-zhuangxiang",
            router: "/boxBind",
          },
          {
            name: "院内暂存",
            icon: "icon-zancun-01",
             router:'/yardStroeInfo'
          },
        ],
        [
          {
            name: "院内出库",
            icon: "icon-chuku1",
             router:'/outStock'
          },
          {
            name: "院外转运",
            icon: "icon-zhuanyunche",
          },
          {
            name: "院外暂存",
            icon: "icon-zancun-01",
            router: "/stageOut",
          },
        ],
        [
          {
            name: "院外处理",
            icon: "icon-chuli",
            router: "/handleOut",
          },
          {
            name: "扫码追溯",
            icon: "icon-tubiaolunkuo-",
            router: "/codeReview",
          },
          {
            name: "异常上报",
            icon: "icon-yichangshangbao",
            router: "/uploadAbnormal",
          },
        ],
      ],
    };
  },
  methods: {
    onChange(index) {
      this.current = index;
    },
    toRouter(router) {
      this.$router.push({
        path: router,
      });
    },
  },
};
</script>

<style lang="less" scoped>
.content {
  width: 100vw;
  .clomn-style {
    display: flex;
    flex-direction: column;
    //   height: 50vh;
    .row-style {
      display: flex;
      justify-content: space-around;
      align-items: center;
      margin: 2vh 0;
      & div {
        text-align: center;
      }
      & span {
        display: block;
        margin-top: 10px;
        font-size: 0.8rem;
      }
      .icon-style {
        border-radius: 50%;
        height: 50px;
        width: 50px;
        background-color: #ffffff;
        border: 1px solid #07c160;
      }
    }
  }
  .custom-indicator {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px 5px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.1);
  }
  & .scansell-img {
    width: 100vw;
    height: 30vh;
  }
}
</style>
